<?php
$today = date("G");
$mode = $_GET["mode"];

if ($mode == "serverinfo") {
    $filename = "serverinfo.txt";
    $handle = fopen ($filename, "rb");
    $contents = fread ($handle, filesize ($filename));
    echo $contents;
    fclose ($handle);
}

if ($mode == "getnotice") {
    if ($today >= 5) {
        $filename = "notice.txt";
    } else {
        $filename = "notice-weekend.txt";
    }
    // echo $today;
    $handle = fopen ($filename, "rb");
    $contents = fread ($handle, filesize ($filename));
    echo $contents;
    fclose ($handle);
}

if ($mode == "serverconfig") {
    $filename = "serverconfig.txt";
    $handle = fopen ($filename, "rb");
    $contents = fread ($handle, filesize ($filename));
    echo $contents;
    fclose ($handle);
}

?>